<?php
/**
 * DBShop 电子商务系统
 *
 * ==========================================================================
 * @link      https://www.dbshop.net/
 * @copyright 北京珑大钜商科技有限公司，并保留所有权利。
 * @license   https://www.dbshop.net/license.html License
 * ==========================================================================
 *
 * @author    静静的风 <baron@loongdom.cn>
 *
 */

namespace Sales\Repository\QuerySearch;


use Doctrine\ORM\QueryBuilder;

class OrderGoodsEvaluationBaseSearch
{
    /**
     * 后台评价检索
     * @param $search
     * @param QueryBuilder $queryBuilder
     * @return QueryBuilder
     */
    public static function querySearchData($search, QueryBuilder $queryBuilder)
    {
        if(isset($search['goods_name']) && !empty($search['goods_name'])) $queryBuilder->andWhere($queryBuilder->expr()->like('g.goodsName', ':goodsName'))->setParameter('goodsName', '%'.$search['goods_name'].'%');

        return $queryBuilder;
    }
}